package work.mediway.common.domain.constant;

import cn.hutool.core.util.StrUtil;

/**
 * 脱敏规则枚举
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2020/4/3
 */
public class SensitiveRuleConstant {

    /**
     * 姓名
     */
    public static final String NAME = "NAME";

    /**
     * 电话
     */
    public static final String PHONE = "PHONE";

    /**
     * 身份证
     */
    public static final String ID_CARD = "ID_CARD";

    /**
     * 地址
     */
    public static final String ADDRESS = "ADDRESS";


    /**
     * 任意字符串
     */
    public static final String ANY_STR = "ANY_STR";

    /**
     * 任意字符串
     */
    public static final String SPECIAL_NUM = "SPECIAL_NUM";

    /**
     * 替换类型
     */
    public static final String REPLACE = "REPLACE";
    /**
     * AES类型
     */
    public static final String AES = "AES";
    /**
     * RSA类型
     */
    public static final String RSA = "RSA";

    public static boolean contains(String rule) {
        return StrUtil.equalsAnyIgnoreCase(rule, NAME, PHONE, ID_CARD, ADDRESS, ANY_STR, SPECIAL_NUM);
    }

}





